<%@ page language="java" pageEncoding="UTF-8"%>
<!doctype html>
<html lang="zh-CN">
<head>
<title>银成教育</title>
<%@include file="/WEB-INF/views/commons/common.jsp"%>
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/login/css/normalize.css" />
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/login/css/default.css">
<link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/login/css/styles.css">
</head>
<body>
	<div class="login-wrap">
			<div class="login-html">
				<input id="tab-1" type="radio" name="tab" class="sign-in" checked><label for="tab-1" class="tab"></label>
				<input id="tab-2" type="radio" name="tab" class="sign-up"><label for="tab-2" class="tab"></label>
				<div class="login-form">
					<form method="post" action="login">
						<div class="sign-in-htm">
							<div class="group">
								<label for="user" class="label">用户名</label>
								<input name="userAccount" type="text" class="input" maxlength="20">
							</div>
							<div class="group">
								<label for="pass" class="label">密码</label>
								<input name="psd" type="password" class="input" data-type="password">
							</div>
							<div class="group">
								<input id="check" type="checkbox" class="check" checked>
								<label for="check"><span class="icon"></span> 记住我</label>
							</div>
							<div class="group">
								<input id="SignIn" type="button" class="button" value="登 录">
								<input id="SignUpReal" type="submit" style="display: none;" value="Sign Up">
							</div>
							<div class="hr"></div>
							<div class="foot-lnk">
<!-- 								<a href="resetpsd.jsp">Forgot Password?</a> -->
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
</body>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/layer/layer.js"></script>

<script>
$(function(){
	
	$("#SignIn").click(function(){
		var checkUrl = basePath + "/checkLogin.json";
		var userAccount = $(".sign-in-htm input[name='userAccount']").val();
		var psd = $(".sign-in-htm input[name='psd']").val();
		$.ajax({
			url: checkUrl,
			type: "post",
			data: {"userAccount": userAccount, "psd": psd },
			dataType:"json",
			success: function(r){
				if(r == null){
					layer.msg('登录失败，请稍后再试');
				}
				if( r.code != "OK"){
					layer.msg(r.message);
				}
				if(r.code == "OK"){
					$("#SignUpReal").click();
				}
			},
			fail:function(){
				layer.msg('服务器异常，请稍后再试或联系管理员');
			}
		});
		
	})
	

});
</script>
</html>